package com.set.treeset;

import java.util.Comparator;
import java.util.TreeSet;

public class SortNumbers {
public static void main(String[] args) {
	TreeSet t=new TreeSet(new MySortComparator());
	t.add(10);
	t.add(0);
	t.add(15);
	t.add(20);
	t.add(20);
	System.out.println(t);
}
}
class MySortComparator implements Comparator{

	
	public int compare(Object o1, Object o2) {
		Integer i1=(Integer)o1;
		Integer i2=(Integer)o2;
		/*if(i1<i2)
			return +20;
		else if(i1>i2)
			return -20;
		return 0;*/
		return -i1.compareTo(i2);
	}
	
}